package edu.nf.takeoutdemo.mapper;

import edu.nf.takeoutdemo.commons.base.BaseMapper;
import edu.nf.takeoutdemo.model.entity.ShoppingCart;

import java.util.List;

/**
 *
 * @author zjl
 * @date 2025/10/29
 */
public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {

    List<ShoppingCart> list(ShoppingCart shoppingCart);

    /**
     * 根据id修改商品数量
     * @param shoppingCart
     */
    void updateNumberById(ShoppingCart shoppingCart);

    /**
     * 根据用户id清空购物车
     * @param userId
     */
    void deleteByUserId(Long userId);

    /**
     * 批量插入购物车数据
     * @param shoppingCartList
     */
    void addBatch(List<ShoppingCart> shoppingCartList);
}
